function UTaxon() {
	var _uKey = UKey.getInstance();
	var _uData = UData.getInstance();
	var _message = UMessage.getInstance();	
	var _taxon = null;
	var self = this;
	
	this.show = function(urlObj, options) {
		var id = urlObj.hash.replace( /.*tId=/, "" );
		_taxon = _uData.findTaxaById(id);
		if ( _taxon == null ) {
			return;
		}

		var pageSelector = urlObj.hash.replace( /\?.*$/, "" );
		var $page = $( pageSelector );
		var $header = $page.children( ":jqmData(role=header)" );
		
		
		var content = '';
		content += outImages(_taxon.images);
		content += showTaxaListGetAttributeValue(_taxon, _uKey.getData().characters);
		
		$msg = _message.getOnly('t' + _taxon.id);
		if ( UUtil.isNull($msg)) {
			$msg = _taxon.name;
		}
		$header.find("h1").html( $msg );		
		$('#uPT_content').html(content).trigger("create");
		
		$page.page();
		options.dataUrl = urlObj.href;
		$.mobile.changePage( $page, options );
	};

	
	function showTaxaListGetAttributeValue(taxon, characterList) {
		var t = '';
		
		if ( !characterList  ) {
			return t;
		}
		t += '<p>';
		var uData = UData.getInstance();
		for (var j=0; j<characterList.length; j++) {
			var c = characterList[j];
			var attValue = uData.findTaxonAttribute(taxon, c);
			
			if ( attValue ) {
				var attValueStr = _uKey.attributeToString(c, attValue);
				if ( !UUtil.isNull(attValueStr)) {
					$msg = _message.getOnly('c' + c.id);
					if ( UUtil.isNull($msg)) {
						$msg = c.name;
					}
					t += $msg + ': <span class="uPT_charValue">' + attValueStr + '</span>. <br/>';
				}
			} 
		}
		t += '</p>';
		return t;
	}	
	
	function outImages(images) {
		if ( !images || images.length < 1 ) {
			return '';
		}
		var t = '<center>';
		t += '<p>';
		for (var i=0; i<images.length; i++) {
			var image = images[i];
			if ( !image ) {
				continue;
			}
			var url = UUtil.getImageURL(image);
			var urlM = UUtil.getTaxaMobileImage(_uKey.getData(), image.f);
			if ( !UUtil.isNull(urlM)) {
				t += '<a href="' + url + '" target="_uPhoto">';
				t += '<IMG class="uPT_taxonPhoto" src="' + urlM + '"/>';
				t += '</a>';
				if ( !UUtil.isNull(image.n) ) {
					t += '<p>' + image.n + '</p>';
				}
			}
		}
		t += '</p>';
		t += '</center>';
		return t;
	}

}

UTaxon.getInstance = function() {
	if ( UTaxon._instance == null ) {
		UTaxon._instance = new UTaxon();
	}
	return UTaxon._instance;
};
